package org.lzy.shop.adapter

import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import org.lzy.shop.R
import org.lzy.shop.response.HomeClassifyTree
import org.lzy.shop.util.setUrl

class ClassifyTwoAdapter: BaseQuickAdapter<HomeClassifyTree, QuickViewHolder>() {



    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): QuickViewHolder {
        return QuickViewHolder(R.layout.item_classify_two, parent)
    }

    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: HomeClassifyTree?) {
        item?.let {
            holder.setText(R.id.tv_name, item.name)
            setUrl(item.pic,holder.getView(R.id.item_classify_right_icon))
        }


    }
}